<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="com.googlecode.contests_repo.core.model.DownloadUtils"%>
<%@page import="com.googlecode.contests_repo.core.config.ConfigurationManager"%>
<%@page import="java.io.File"%>
<%@page import="com.googlecode.contests_repo.core.*"%>

	<%
		String filePath = request.getParameter("path");
		if (filePath != null) {
			String resourceFile = filePath.substring(filePath
					.lastIndexOf(File.separator) + 1);
			String repoRoot = ConfigurationManager.getInstance()
					.getRepoRoot();
			DownloadUtils.downloadFile(
					repoRoot + File.separator + filePath, resourceFile,
					response);
			response.sendRedirect(String.format("resource.jsp?path=\"%s\"",
					WebTools.getRelativeParentPath(filePath)));
		}
	%>
